package com.codi.bus.core.dao.impl;

import com.codi.base.dao.v2.GeneratedBaseDaoImpl;
import com.codi.bus.core.dao.TradeNoticeDao;
import com.codi.bus.core.domain.TradeNotice;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author lvgo
 * @version 1.0
 * @Description: 交易报备号mapper
 * @date 2018/5/9 11:03
 */
@Repository("tradeNoticeDao")
public class TradeNoticeDaoImpl extends GeneratedBaseDaoImpl<TradeNotice> implements TradeNoticeDao {
    @Override
    public List<TradeNotice> getListByProfileId(String profileId) {
        return this.findList(generateStatement("getListByProfileId"), profileId);
    }

    @Override
    public TradeNotice getByMobile(String profileId, String mobile) {
        Map<String, String> params = new HashMap<>();
        params.put("profileId", profileId);
        params.put("mobile", mobile);
        return getSqlSession().selectOne(generateStatement("getByMobile"), params);
    }
}
